import QtQuick 2.10
import QtQuick.Controls.Material 2.3
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import "../Normal"


Item{
    id:root
    width:  sliderWidth + 48*2
    height: 48

    signal moved

    property alias currentValue: control.currentValue
    property real minValue:0
    property real maxValue
    property real stepValue

    property bool isHorizontal:true

    property color indicatorNormal :"#0FE950"

    property int sliderWidth



    RowLayout{
        spacing: 10
        anchors.fill: parent

        ToolButton{
            Layout.alignment: Qt.AlignVCenter
            icon.source:"content/deValid.svg"
            onClicked:{
                currentValue -= stepValue
            }
        }

        MSlider{
            id:control
            Layout.bottomMargin: 13
            indicatorNormal:indicatorNormal
            isHorizontal:isHorizontal
            sliderWidth:root.sliderWidth
            maxValue: root.maxValue
            stepValue:root.stepValue
            onMoved: {
                emit:root.moved()
            }
        }

        ToolButton{
            Layout.alignment: Qt.AlignVCenter
            icon.source:"content/inVaild.svg"
            onClicked:{
                currentValue += stepValue
            }
        }

    }





}


